#ifndef ALGORITHM_H
#define ALGORITHM_H

#include <iostream>
#include <vector>
#include "Task.h"

class Algorithm
{
public:
	Algorithm(std::vector<Task> tasks):uB(INT_MAX),tasks(tasks){}
	int Schrage(bool PMT);
	int Calier();
private:
	int B(int &U);
	int A(int &U,int &b);
	std::vector<Task> tasks;
	std::vector<Task> order;
	std::vector<Task> bestOrder;
	std::vector<Task> tabG;
	int uB;
	int MinR();
	int MaxQ(std::vector<Task> &tabG);
	int g,g2,n,Rid,Qid;
	void FindTask();
	bool CmaxCalculate(int &Cmax,Task &task,int &t);
	int lowBand(int &task,int &order_value,int pp,int &c,std::vector<Task> &tmpTasks);
};

#endif